define(["utils","base"],function(utils,baseClass){
    var Component = function(config){
        var _this = this;
        Component.baseConstructor.call(this,config);
        this.config.style = this.config.style||{};
        this.$el.addClass("displayflex yy-input flex-h");
        var mode = this.config.mode||"text";
        var placeholder = this.config.placeholder||"";
        this.input = $("<input class='yy-flex-1' placeholder='"+placeholder+"' type='"+mode+"'></input>");
        var inputStyle = {
          fontSize:this.config.style.fontSize||"13px",
          color:this.config.style.color||"black"
        };
        utils.css(this.input,inputStyle);
        this.$el.append(this.input);
    }

    utils.extends(Component,baseClass);

    Component.prototype.getValue = function(){
      return $.trim(this.input.val());
    };
    Component.prototype.setValue = function(val){
      this.input.val(val);
    };

    return Component;
});
